.class public Lorg/zeam/ApplicationsAdapter;
.super Landroid/widget/ArrayAdapter;
.source "ApplicationsAdapter.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Lorg/zeam/ApplicationItemInfo;",
        ">;"
    }
.end annotation


# instance fields
.field private final mLayoutInflater:Landroid/view/LayoutInflater;

.field private mUninstalling:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/ArrayList;)V
    .locals 1
    .parameter "context"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/ArrayList",
            "<",
            "Lorg/zeam/ApplicationItemInfo;",
            ">;)V"
        }
    .end annotation

    .prologue
    .local p2, applicationItemInfos:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lorg/zeam/ApplicationItemInfo;>;"
    const/4 v0, 0x0

    .line 21
    invoke-direct {p0, p1, v0, p2}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    .line 16
    iput-boolean v0, p0, Lorg/zeam/ApplicationsAdapter;->mUninstalling:Z

    .line 22
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lorg/zeam/ApplicationsAdapter;->mLayoutInflater:Landroid/view/LayoutInflater;

    .line 23
    return-void
.end method


# virtual methods
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 10
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    const/4 v9, -0x1

    const/4 v8, 0x0

    .line 28
    invoke-virtual {p0}, Lorg/zeam/ApplicationsAdapter;->getContext()Landroid/content/Context;

    move-result-object v2

    .line 29
    .local v2, context:Landroid/content/Context;
    invoke-virtual {p0, p1}, Lorg/zeam/ApplicationsAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lorg/zeam/ApplicationItemInfo;

    .line 31
    .local v1, applicationItemInfo:Lorg/zeam/ApplicationItemInfo;
    if-nez p2, :cond_0

    .line 32
    iget-object v5, p0, Lorg/zeam/ApplicationsAdapter;->mLayoutInflater:Landroid/view/LayoutInflater;

    const v6, 0x7f030001

    const/4 v7, 0x0

    invoke-virtual {v5, v6, p3, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    .line 34
    :cond_0
    iget-boolean v5, v1, Lorg/zeam/ApplicationItemInfo;->filtered:Z

    if-nez v5, :cond_1

    .line 35
    iget-object v5, v1, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    invoke-static {v5, v2}, Lorg/zeam/Utilities;->createIconThumbnail(Landroid/graphics/drawable/Drawable;Landroid/content/Context;)Landroid/graphics/drawable/Drawable;

    move-result-object v5

    iput-object v5, v1, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    .line 36
    const/4 v5, 0x1

    iput-boolean v5, v1, Lorg/zeam/ApplicationItemInfo;->filtered:Z

    .line 38
    :cond_1
    move-object v0, p2

    check-cast v0, Landroid/widget/TextView;

    move-object v4, v0

    .line 41
    .local v4, textView:Landroid/widget/TextView;
    iget-boolean v5, p0, Lorg/zeam/ApplicationsAdapter;->mUninstalling:Z

    if-eqz v5, :cond_3

    .line 42
    invoke-static {v2, v1}, Lorg/zeam/Utilities;->canUninstallApplication(Landroid/content/Context;Lorg/zeam/ApplicationItemInfo;)Z

    move-result v5

    if-eqz v5, :cond_2

    .line 44
    invoke-virtual {v4, v9}, Landroid/widget/TextView;->setTextColor(I)V

    .line 45
    iget-object v5, v1, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    invoke-static {v2, v5}, Lorg/zeam/Utilities;->overlayUninstallIcon(Landroid/content/Context;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    .line 54
    .local v3, iconDrawable:Landroid/graphics/drawable/Drawable;
    :goto_0
    invoke-virtual {v4, v8, v3, v8, v8}, Landroid/widget/TextView;->setCompoundDrawablesWithIntrinsicBounds(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V

    .line 55
    iget-object v5, v1, Lorg/zeam/ApplicationItemInfo;->title:Ljava/lang/CharSequence;

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 56
    return-object p2

    .line 47
    .end local v3           #iconDrawable:Landroid/graphics/drawable/Drawable;
    :cond_2
    const v5, -0x777778

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setTextColor(I)V

    .line 48
    iget-object v5, v1, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    invoke-static {v5}, Lorg/zeam/Utilities;->adjustIconOpacity(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    .restart local v3       #iconDrawable:Landroid/graphics/drawable/Drawable;
    goto :goto_0

    .line 51
    .end local v3           #iconDrawable:Landroid/graphics/drawable/Drawable;
    :cond_3
    invoke-virtual {v4, v9}, Landroid/widget/TextView;->setTextColor(I)V

    .line 52
    iget-object v3, v1, Lorg/zeam/ApplicationItemInfo;->icon:Landroid/graphics/drawable/Drawable;

    .restart local v3       #iconDrawable:Landroid/graphics/drawable/Drawable;
    goto :goto_0
.end method

.method setUninstalling(Z)V
    .locals 0
    .parameter "uninstalling"

    .prologue
    .line 60
    iput-boolean p1, p0, Lorg/zeam/ApplicationsAdapter;->mUninstalling:Z

    .line 61
    return-void
.end method
